Q: What does a Node object represent?
Solution: The Node object represents a single node in the document tree. A node can be an element node, an attribute node, a text node, or any other of the node types explained in the Node Types chapter.
Q: What does the nodeName of the nodeType Document return?
Solution: The nodeName of the nodeType Document returns #document. If the node is an element node, the nodeName property will return the tag name. If the node is an attribute node, the nodeName property will return the name of the attribute.
Q: What is the purpose of the method item()?
Solution: The method item() returns the node at the specified index in a node list. The nodes are sorted as they appear in the source code, and the index starts at 0.A Node object’s collection of child nodes is an example of a NodeList object.
Q: How can the nodes in the node list be accessed?
Solution: The nodes in the node list can be accessed through their index number. The nodes are sorted as they appear in the source code, and the index starts at 0.
Q: Which of the following is the child(s) of the node type EntityReference?
Solution: The createEntityReference() method creates the specified EntityReference Object. The children of the node type EntityReference are Element, ProcessingInstruction, Comment, Text, CDATASection, EntityReference.
Q: Which node type represents the root-node of the DOM tree?
Solution: Everything inside an html document is classified in the form of different nodes. The node type Document represents the root-node of the DOM tree, the entire document.
Q: What is the purpose of the DocumentFragment node type?
Solution: The DocumentFragment node type represents a “lightweight” Document object that has no parent. It is used as a lightweight version of Document that stores a segment of a document structure comprised of nodes just like a standard document.
Q: How many nodetype – named constants are available?
Solution: DOM nodes can be of various types, such as element nodes and text nodes, and each node has a nodeType property giving its type. There are totally 12 nodetype – named constants available.
Q: Which of the following Node types have a node value equal to null?
Solution: All the three node types namely, Document, DocumentFragment, DocumentType have a node value equal to null. If the node is an element node, the nodeType property will return 1. If the node is an attribute node, the nodeType property will return 2.
Q: How many node object properties are there?
Solution: Node interface is the primary datatype for the entire Document Object Model. The node is used to represent a single XML element in the entire document tree. There are totally 16 node object properties.
You Have Score    | /10 |